
[#macro productShowView]
<div  class="model-form">
    <el-page-header @back="goBack" content="详情">
    </el-page-header>

        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
            <el-menu-item index="1">
                商品详情
            </el-menu-item>
        </el-menu>
        <div>
            <router-view></router-view>
        </div>

</div>
[/#macro]
[#macro productShowConfig]
<script type="text/x-template" id="my-product-show">
    [@productShowView /]
</script>
	<script type="text/javascript">
		//显示组件开始
		var productShowConfig = {};
		productShowConfig.template = "#my-product-show";
		productShowConfig.methods =config.basicMethod();
		productShowConfig.data = function () {
			return {
				viewModel: {
				},
				activeIndex: "1"
			}
		};

		productShowConfig.methods.handleSelect = function (index) {
			console.log(index)
			var selectId = this.selectId;
			if (index == "1") {
				this.$router.replace({ path: '/view/index', query: { id: selectId, activeIndex: 1, time: Math.random() } })
			}
			else if (index == "2") {
				this.$router.replace({ path: '/view/members', query: { id: selectId, activeIndex: 2, time: Math.random() } })
			} else {

			}
		};

		productShowConfig.mounted = function () {
		   	var id = this.$route.query.id;
			var activeIndex = this.$route.query.activeIndex;

			var self = this;
			var data = {};
			data.id = id;
			this.selectId = data.id;
			if (activeIndex) {
				this.activeIndex = activeIndex;
			}
		}
		var productShowView = Vue.component('my-product-view', productShowConfig);
		//显示组件结束		
	</script>
[/#macro]



[#macro childProductView]
    <div >
        <el-form class="viewForm" label-width="80px">
            <el-col :span="22">
                <el-form-item label="商品封面">
                    <div v-html="viewModel.logo">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品名称">
                    <div v-html="viewModel.name">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商家名称">
                    <div v-html="viewModel.shopName">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品分类">
                    <div v-html="viewModel.productCatalogName">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品分组">
                    <div v-html="viewModel.productGroupName">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品编码">
                    <div v-html="viewModel.barCode">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品简介">
                    <div v-html="viewModel.summary">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="是否开票">
                    <div v-html="viewModel.invoice">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="商品状态">
                    <div v-html="viewModel.productStateName">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="是否开启规格">
                    <div v-html="viewModel.skuEnable">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="销售价">
                    <div v-html="viewModel.salePrice">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="市场价">
                    <div v-html="viewModel.marketPrice">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="成本价">
                    <div v-html="viewModel.costPrice">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="积分">
                    <div v-html="viewModel.score">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="vip价">
                    <div v-html="viewModel.vipPrice">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="库存量">
                    <div v-html="viewModel.inventory">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="库存预警值">
                    <div v-html="viewModel.warningValue">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="毛重">
                    <div v-html="viewModel.weight">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="体积">
                    <div v-html="viewModel.volume">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="净重">
                    <div v-html="viewModel.netWeight">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="高">
                    <div v-html="viewModel.height">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="宽">
                    <div v-html="viewModel.width">></div>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="高">
                    <div v-html="viewModel.length">></div>
                </el-form-item>
            </el-col>
            <el-col :span="22">
                <el-form-item label="商品介绍">
                    <div v-html="viewModel.note">></div>
                </el-form-item>
            </el-col>
        </el-form>
    </div>
 [/#macro]

[#macro childProductConfig]
    <script type="text/x-template" id="child-product-show">
        [@childProductView /]
    </script>
    <script type="text/javascript">

        var childProductShowConfig = {};
        childProductShowConfig.template = "#child-product-show";
        childProductShowConfig.methods = config.basicMethod();
        childProductShowConfig.data = function () {
            return {
                viewModel: {
                }
            }
        };
        childProductShowConfig.mounted = function () {
            var id = this.$route.query.id;
            var self = this;
            var data = {};
            data.id = id;
            this.postData("${siteurl}tenantRest/product/view.htm", data, function (res) {
                if (res.code == 0) {
                    self.viewModel = res;

                }
            });
        }
        var childProductShowView = Vue.component('child-product-show', childProductShowConfig);
    </script>
[/#macro]

